package org.mili.ticketeer.ui.role;

import org.mili.ticketeer.dto.Role;
import org.mili.ticketeer.dto.State;
import org.mili.ticketeer.service.RoleService;
import org.mili.ticketeer.service.ServiceException;
import org.mili.ticketeer.service.ServiceFactory;
import org.mili.ticketeer.ui.Form;
import org.mili.ticketeer.ui.SearchPanel;

/**
 * Created with IntelliJ IDEA.
 * User: papa
 * Date: 20.07.13
 * Time: 14:10
 * To change this template use File | Settings | File Templates.
 */
public class RoleSearchPanel extends SearchPanel<Role> {
    private static RoleService roleService = ServiceFactory.getService(RoleService.class);

    public RoleSearchPanel() {
        super(new RoleTableModel());
    }

    @Override
    public void formChanged(Form form) {
        getTableModel().update();
    }

    @Override
    public Role create() {
        return new Role();
    }

    @Override
    public void delete(Role element) throws ServiceException {
        roleService.delete(element);
    }
}
